package api

import (
	"context"
	"tencent-video-desktop/backend/internal/models"
	"tencent-video-desktop/backend/internal/services"
)

type VideoHandler struct {
	ctx         context.Context
	videoService *services.VideoService
}

func NewVideoHandler(videoService *services.VideoService) *VideoHandler {
	return &VideoHandler{
		videoService: videoService,
	}
}

func (h *VideoHandler) GetVideos() []models.Video {
	return h.videoService.GetVideos()
}

func (h *VideoHandler) GetVideoByID(id uint) *models.Video {
	return h.videoService.GetVideoByID(id)
}

func (h *VideoHandler) SearchVideos(keyword string) []models.Video {
	return h.videoService.SearchVideos(keyword)
}

func (h *VideoHandler) GetVideosByCategory(category string) []models.Video {
	return h.videoService.GetVideosByCategory(category)
}
